﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SoundManager : MonoBehaviour {

	public static SoundManager Instance;

	public AudioClip[] clips;

	public AudioSource bgmAudioSource;
	public AudioSource soundSource;

	void Awake() 
	{
		Instance = this;
	}

	// Use this for initialization
	void Start () 
	{
		//Instance = this;
		//sourceList = new List<AudioSource>();
		PlayBGMusic();
	}

	public void PlayGetSound()
	{
		soundSource.clip = clips[1];
		soundSource.Play();
	}

	public void PlayLoseSound()
	{
		bgmAudioSource.clip = clips[2];
		bgmAudioSource.loop = false;
		bgmAudioSource.Play();
	}

	public void PlayFirstGenerateBallSound()
	{
		soundSource.clip = clips[3];
		soundSource.Play();
	}

	public void PlayBGMusic()
	{
		bgmAudioSource.clip = clips[0];
		bgmAudioSource.loop = true;
		bgmAudioSource.Play();
	}
	
	// Update is called once per frame
	void Update () 
	{
		
	}
}
